package com.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface SetmealDishMapper extends BaseMapper<SetmealDish> {

    @Select("select setmeal_id from setmeal_dish where dish_id =#{DishId}")
    List<Long> selectSetmealIdByDishId(Integer DishId);

    @Select("select dish_id from  setmeal_dish where setmeal_id=#{setmealId}")
    List<Long> selectDishIdBySetmealId(Long setmealId);
    @Select("select * from setmeal_dish where  setmeal_id =#{setmealId}")
    List<SetmealDish> selectBySetmealId(Long setmealId);
    @Delete("delete from  setmeal_dish where setmeal_id =#{setmealId}")
    void deleteBySetmealId(Long setmealId);

    void insertBatch(List<SetmealDish> setmealDishes);

    void deleteBySetmealIds(List<Long> ids);
}
